<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <h1>今天又是努力的一天！！</h1>
    <div @click="fatherClick">
      父元素<br>
      <!-- @click.stop阻止冒泡 -->
      <button @click="conClick">子元素</button>
    </div>
    <!-- prevent阻止默认行为 -->
    <a href="https://itheima.com" @click.prevent>黑马</a>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  <script>
    const aoo = new Vue({
      el: '#app',
      data: {
        //
      },
      methods: {
        fatherClick() {
          alert('父元素')
        },
        conClick() {
          alert('子元素')
        }
      }
    })
  </script>
</body>

</html>